package com.bdv.md.en;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public enum HTTPValues {
	// TYPE NAME TO SEND FOR USSD
	TYPE_SUBMIT_TOKEN("SubmitToken"), 
	TYPE_SUBMIT_TOKEN_RESP("SubmitTokenResp"),
	TYPE_TOPUP_RESULT("TopupResult"),
	TYPE_TOPUP_RESULT_RESP("TopupResultResp"),
	
	TYPE_SUBMIT_SET_CL("SubmitSetCL"), 
	TYPE_SUBMIT_SET_CL_RESP("SubmitSetCLResp"),
	TYPE_CREDIT_LIMIT_RESULT("CLResult"), 
	TYPE_CREDIT_LIMIT_RESULT_RESP("CLResultResp"), 
	
	TYPE_SUBMIT_READ_METER("SubmitReadMeter"), 
	TYPE_SUBMIT_READ_METER_RESP("SubmitMeterReadResp"),
	TYPE_METER_DATA("MeterData"),
	TYPE_METER_DATA_RESP("MeterDataResp"),
	
	TYPE_SUBMIT_TOKEN_HIST("SubmitTH"), 
	TYPE_SUBMIT_TOKEN_HIST_RESP("SubmitTHResp"),
	TYPE_TOKEN_HIST_DATA("THData"),
	TYPE_TOKEN_HIST_DATA_RESP("THDataResp"),
	
	TYPE_SUBMIT_BILLING_HIST("SubmitBillHis"), 
	TYPE_SUBMIT_BILLING_HIST_RESP("SubmitBillHisResp"),
	TYPE_BILLING_HIST_DATA("BillHisData"),
	TYPE_BILLING_HIST_DATA_RESP("BillHisDataResp"),
	
	
	// ALERT
	TYPE_ALERT("SubmitAlertTelkom"),
	TYPE_ALERT_RESP("SubmitAlertTelkomResp"),
	
	// NAME TO SEND/RECEIVE FOR/FROM MGT
	TIPE_METER("tipe_meter"),
	TIPE_PELANGGAN("tipe_plg"),
	TIPE_PU("tipe_pu"),
	ALERT_INTERVAL("alert_interval"),
	KERAN_INTERVAL("keran_interval"),
	JOB_IDKERAN("job_idkeran"),
	// REPORT FOR PERIODIC TYPE ONLY
	START_DATE("start_date"), // Greater Equal
	END_DATE("end_date"), // Less Equal
	

	// POST PAID
	//AMR
	TYPE_SUBMIT_METER_READING_PP("SubmitReadMeterPP"), 
	TYPE_SUBMIT_METER_READING_PP_RESP("SubmitReadMeterPPResp"),
	TYPE_METER_READING_PP("ReadMeterPP"),
	TYPE_METER_READING_PP_RESP("ReadMeterPPResp"),
	//LOAD PROFILE
	TYPE_SUBMIT_LOAD_PROFILE_PP("SubmitLoadProfilePP"), 
	TYPE_SUBMIT_LOAD_PROFILE_PP_RESP("SubmitLoadProfilePPResp"),
	TYPE_LOAD_PROFILE_PP("LoadProfilePP"),
	TYPE_LOAD_PROFILE_PP_RESP("LoadProfilePPResp"),
	//EVENT LOG
	TYPE_SUBMIT_EVENT_LOG_PP("SubmitEventLogPP"), 
	TYPE_SUBMIT_EVENT_LOG_PP_RESP("SubmitEventLogPPResp"),
	TYPE_EVENT_LOG_PP("EventLogPP"),
	TYPE_EVENT_LOG_PP_RESP("EventLogPPResp"),
	//BILLING
	TYPE_SUBMIT_BILLING_PP("SubmitBillingPP"), 
	TYPE_SUBMIT_BILLING_PP_RESP("SubmitBillingPPResp"),
	TYPE_BILLING_PP("BillingPP"),
	TYPE_BILLING_PP_RESP("BillingPPResp"),
	//ALARM
	TYPE_ALARM_PP("AlarmPP"),
	TYPE_ALARM_PP_RESP("AlarmPPResp"),
	//RECALL LOAD PROFILE
	TYPE_SUBMIT_RECALL_LOAD_PROFILE_PP("SubmitRecallLoadProfilegPP"), 
	TYPE_SUBMIT_RECALL_LOAD_PROFILE_PP_RESP("SubmitRecallLoadProfilePPResp"),
	TYPE_RECALL_LOAD_PROFILE_PP("RecallLoadProfilePP"),
	TYPE_RECALL_LOAD_PROFILE_PP_RESP("RecallLoadProfilePPResp"),
	//TIME SYNC
	TYPE_SUBMIT_TIME_SYNC_PP("SubmitTimeSyncPP"), 
	TYPE_SUBMIT_TIME_SYNC_PP_RESP("SubmitTimeSyncPPResp"),
	TYPE_TIME_SYNC_PP("TimeSyncPP"),
	TYPE_TIME_SYNC_PP_RESP("TimeSyncPPResp"),
	//REMOTE
	TYPE_SUBMIT_REMOTE_PP("SubmitRemotePP"), 
	TYPE_SUBMIT_REMOTE_PP_RESP("SubmitRemotePPResp"),
	TYPE_REMOTE_PP("RemotePP"),
	TYPE_REMOTE_PP_RESP("RemotePPResp"),
	//SCADA SYSTEM
	TYPE_SUBMIT_SCADA_SYSTEM_PP("SubmitScadaSystemPP"), 
	TYPE_SUBMIT_SCADA_SYSTEM_PP_RESP("SubmitScadaSystemPPResp"),
	TYPE_SCADA_SYSTEM_PP("ScadaSystemPP"),
	TYPE_SCADA_SYSTEM_PP_RESP("ScadaSystemPPResp"),
	
	//PRE PAID
	MSISDN("msisdn"), 
	TX_ID("tx_id"), 
	TOKEN_TX_STATUS("token_tx_status"), 
	JENIS_TOKEN("jenis_token"), 
	BALANCE_KWH("balance_kwh"),
	PAYMENT_MODE("payment_mode"),
	METER_ID("meter_id"), 
	TOTAL_USAGE("total_usage"), 
	VOLTAGE_R("voltage_r"), 
	VOLTAGE_S("voltage_s"), 
	VOLTAGE_T("voltage_t"), 
	ARUS_T("arus_t"), 
	ARUS_S("arus_s"), 
	ARUS_R("arus_r"), 
	POWER_FACTOR("power_factor"), 
	DAYA_INSTANT("daya_instant"), 
	TARIF_INDEX("tarif_index"), 
	STATUS_TAMPER("status_tamper"), 
	TOTAL_OFF("total_off"), 
	PREDIKSI_KREDIT_HABIS("prediksi_kredit_habis"), 
	PAYMENT_MODE_METER_TYPE("pmmt"), 
	SUDUT_I("sudut_i"), 
	SUDUT_V("sudut_v"), 
	SUDUT_R("sudut_r"), 
	FIRMWARE("firmware"), 
	TIMESTAMP("timestamp"), 
	ALERT_LIM_BALANCE("alb"), 
	ALERT_ISI_TOKEN("ait"), 
	NO_TOKEN("no_token"),
	NILAI_TOKEN("nilai_token"), 
	TIPE_ALERT("tipe_alert"), 
	POWER_STATUS("power_status"),
	LIM_KREDIT("lim_kredit"), 
	SET_ALARM("set_alarm"),
	TOKEN_ARR("token[]"),
	NET_ELECTRICITY_CONSUMPTION_ARR("nec[]"),
	RECHARGE_POWER_CONSUMPTION_ARR("rpc[]"),

	//POST PAID
	HEXA_MSG("hexa_msg"),
	STATUS("status"),
	REMOTE("remote"),
	NETWORK_STATUS("network_status"),
	
	CURRENT_R("current_r"),
	CURRENT_S("current_s"),
	CURRENT_T("current_t"),
	POWER_FACTOR_R("power_factor_r"),
	POWER_FACTOR_S("power_factor_s"),
	POWER_FACTOR_T("power_factor_t"),
	PHASE_ANGEL_R("phase_angel_r"),
	PHASE_ANGEL_S("phase_angel_s"),
	PHASE_ANGEL_T("phase_angel_t"),
	FREQUENCY("frequency"),
	
	ACTIVE_POWER_R("active_power_r"),
	ACTIVE_POWER_S("active_power_s"),
	ACTIVE_POWER_T("active_power_t"),
	REACTIVE_POWER_R("reactive_power_r"),
	REACTIVE_POWER_S("reactive_power_s"),
	REACTIVE_POWER_T("reactive_power_t"),
	APPARENT_POWER_R("apparent_power_r"),
	APPARENT_POWER_S("apparent_power_s"),
	APPARENT_POWER_T("apparent_power_t"),
	
	STATUS_OUTPUT_DEVICE("status_output_device"),
	TOTAL_ENERGY_APPARENT("total_energy_apparent"),
	
	TOTAL_ENERGY_ACTIVE("total_energy_active"),
	TOTAL_ENERGY_ACTIVE_TARRIF1("total_energy_active_tarrif1"),
	TOTAL_ENERGY_ACTIVE_TARRIF2("total_energy_active_tarrif2"),
	TOTAL_ENERGY_ACTIVE_TARRIF3("total_energy_active_tarrif3"),
	TOTAL_ENERGY_ACTIVE_TARRIF4("total_energy_active_tarrif4"),
	
	TOTAL_ENERGY_REACTIVE("total_energy_reactive"),
	TOTAL_ENERGY_REACTIVE_TARRIF1("total_energy_reactive_tarrif1"),
	TOTAL_ENERGY_REACTIVE_TARRIF2("total_energy_reactive_tarrif2"),
	TOTAL_ENERGY_REACTIVE_TARRIF3("total_energy_reactive_tarrif3"),
	TOTAL_ENERGY_REACTIVE_TARRIF4("total_energy_reactive_tarrif4"),
	
	ACTIVE_MAX_DEMAND_TOTAL("active_max_demand_total"),
	ACTIVE_MAX_DEMAND_TARRIF1("active_max_demand_tarrif1"),
	ACTIVE_MAX_DEMAND_TARRIF2("active_max_demand_tarrif2"),
	ACTIVE_MAX_DEMAND_TARRIF3("active_max_demand_tarrif3"),
	ACTIVE_MAX_DEMAND_TARRIF4("active_max_demand_tarrif4"),
	
	REACTIVE_MAX_DEMAND_TOTAL("reactive_max_demand_total"),
	REACTIVE_MAX_DEMAND_TARRIF1("reactive_max_demand_tarrif1"),
	REACTIVE_MAX_DEMAND_TARRIF2("reactive_max_demand_tarrif2"),
	REACTIVE_MAX_DEMAND_TARRIF3("reactive_max_demand_tarrif3"),
	REACTIVE_MAX_DEMAND_TARRIF4("reactive_max_demand_tarrif4"),
	
	APPARENT_MAX_DEMAND_TOTAL("apparent_max_demand_total"),
	APPARENT_MAX_DEMAND_TARRIF1("apparent_max_demand_tarrif1"),
	APPARENT_MAX_DEMAND_TARRIF2("apparent_max_demand_tarrif2"),
	APPARENT_MAX_DEMAND_TARRIF3("apparent_max_demand_tarrif3"),
	APPARENT_MAX_DEMAND_TARRIF4("apparent_max_demand_tarrif4");
	
	
	private String name;

	private HTTPValues(String n) {
		name = n;
	}

	public String getName() {
		return name;
	}
	public NameValuePair getNameValuePair(Object value){
		return new BasicNameValuePair(getName(), value.toString());
	}
	public List<NameValuePair> getNameValuePair(List<String> values){
		List<NameValuePair> list = new ArrayList<NameValuePair>();
		for(String value : values){
			list.add(getNameValuePair(value));
		}
		return list;
	}
	
	public boolean equal(String type){
		return type.equalsIgnoreCase(name);
	}
}
